import 'package:flutter/material.dart';

import '../../../../../helper/utils/util.dart';
import 'controller.dart';

class NewPwdPage extends GetView<NewPwdController> {
  const NewPwdPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: detailAppBar(context, elevation: 1, title: '忘记密码'),
      body: Padding(
        padding: EdgeInsets.symmetric(horizontal: 31.w),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            SizedBox(
              height: 32.w,
            ),
            Obx(() => UITextField(
                prefixWidth: 70.w,
                controller: controller.state.oldPwdCtrl,
                name: '旧密码',
                hintText: '请输入旧密码',
                obscureText: controller.state.obscureTextOld.value,
                suffixIcon: InkWell(
                  onTap: () {
                    controller.state.obscureTextOld.value =
                        !controller.state.obscureTextOld.value;
                  },
                  child: Icon(
                    controller.state.obscureTextOld.value == true
                        ? IconUtil.eye_close
                        : IconUtil.eye_open,
                    color: const Color(0xff999999),
                    size: 15.r,
                  ),
                ))),
            Obx(() => UITextField(
                prefixWidth: 70.r,
                controller: controller.state.pwdCtrl,
                name: '新密码',
                hintText: '请输入新密码',
                obscureText: controller.state.obscureText.value,
                suffixIcon: InkWell(
                  onTap: () {
                    controller.state.obscureText.value =
                        !controller.state.obscureText.value;
                  },
                  child: Icon(
                    controller.state.obscureText.value == true
                        ? IconUtil.eye_close
                        : IconUtil.eye_open,
                    color: const Color(0xff999999),
                    size: 15.r,
                  ),
                ))),
            Obx(() => UITextField(
                controller: controller.state.pwd1Ctrl,
                prefixWidth: 70.w,
                name: '确认密码',
                hintText: '请输入确认密码',
                obscureText: controller.state.obscureText1.value,
                suffixIcon: InkWell(
                  onTap: () {
                    controller.state.obscureText1.value =
                        !controller.state.obscureText1.value;
                  },
                  child: Icon(
                    controller.state.obscureText1.value == true
                        ? IconUtil.eye_close
                        : IconUtil.eye_open,
                    color: const Color(0xff999999),
                    size: 15.w,
                  ),
                ))),
            separatorLine(),
            SizedBox(
              height: 30.w,
            ),
            ExpandedButton(
              text: '确定',
              onPressed: controller.actionSure,
            )
          ],
        ),
      ),
    );
  }
}
